package cn.finedo.common;

import java.util.Collection;
import java.util.Map;

public class NonUtil {
    public static boolean isNon(Object object) {
        boolean isnon = false;
        if (object == null) {
            return true;
        } else {
            if (object instanceof String) {
                String str = (String) object;
                if (str.trim().length() == 0) {
                    isnon = true;
                }
            } else if (object instanceof Collection) {
                Collection<?> collection = (Collection) object;
                if (collection.size() == 0) {
                    isnon = true;
                }
            } else if (object instanceof Map) {
                Map<?, ?> map = (Map) object;
                if (map.size() == 0) {
                    isnon = true;
                }
            } else if (object instanceof StringBuffer) {
                StringBuffer strbuf = (StringBuffer) object;
                if (strbuf.length() == 0) {
                    isnon = true;
                }
            } else if (object instanceof StringBuilder) {
                StringBuilder strbuf = (StringBuilder) object;
                if (strbuf.length() == 0) {
                    isnon = true;
                }
            } else if (object.getClass().isArray()) {
                Object[] o = (Object[]) ((Object[]) object);
                if (o.length == 0) {
                    isnon = true;
                }
            }

            return isnon;
        }
    }

    public static boolean isNotNon(Object object) {
        return !isNon(object);
    }

    public static boolean allIsNon(Object... args) {
        if (isNon(args)) {
            return true;
        } else {
            Object[] var1 = args;
            int var2 = args.length;

            for (int var3 = 0; var3 < var2; ++var3) {
                Object arg = var1[var3];
                if (isNotNon(arg)) {
                    return false;
                }
            }

            return true;
        }
    }

    public static boolean allIsNotNon(Object... args) {
        if (isNon(args)) {
            return false;
        } else {
            Object[] var1 = args;
            int var2 = args.length;

            for (int var3 = 0; var3 < var2; ++var3) {
                Object arg = var1[var3];
                if (isNon(arg)) {
                    return false;
                }
            }

            return true;
        }
    }

    public static boolean isOrNon(Object... args) {
        if (isNon(args)) {
            return true;
        } else {
            Object[] var1 = args;
            int var2 = args.length;

            for (int var3 = 0; var3 < var2; ++var3) {
                Object arg = var1[var3];
                if (isNon(arg)) {
                    return true;
                }
            }

            return false;
        }
    }

    public static boolean isOrNotNon(Object... args) {
        if (isNon(args)) {
            return false;
        } else {
            Object[] var1 = args;
            int var2 = args.length;

            for (int var3 = 0; var3 < var2; ++var3) {
                Object arg = var1[var3];
                if (isNotNon(arg)) {
                    return true;
                }
            }

            return false;
        }
    }
}
